﻿
/*** 
 * HttpPost保存数据 
 * @url 业务数据 
 * @data 
 */
$.doGetData = function (url, data, fn) {
    $.ajax({
        url: url,
        type: 'GET',
        data: data,
        dataType: 'json',
        success: fn,
        errer: function () {
            alert("服务器错误");
        }
    });
};


/*** 
 * ajax获取服务端数据 
 * @url 业务数据 
 * @data 
 */
$.doAjaxGet = function (url, fn) {
    //$.getJSON(url, fn);  
    $.ajax({
        url: url,
        type: "GET",
        dataType: 'json',
        success: fn, errer: function () {
            alert("服务器错误");
        }
    });
};

/*** 
 * ajax获取服务端数据 
 * @url 业务数据 
 * @data 
 */
$.doAjaxDataGet = function (url,data, fn) {
    //$.getJSON(url, fn);  
    $.ajax({
        url: url,
        type: "GET",
        dataType: 'json',
        data: data,
        success: fn, errer: function () {
            alert("服务器错误");
        }
    });
};


$.doJsonPost = function (url, data, fn) {
    $.ajax({
        url: url,
        type: 'POST',
        data: data,
        dataType: 'json',
        contentType: 'application/json',
        success: fn,
        errer: function () {
            alert("服务器错误");
        }
    });
};
